﻿using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using System;
using System.Collections.Generic;
using System.Text;

namespace Quickuse.Logging.EmailLogger
{
    /// <summary>
    /// IEmailLoggerSettings
    /// </summary>
    internal interface IEmailLoggerSettings
    {
        /// <summary>
        /// 应用标识
        /// </summary>
        string AppId { get; }

        /// <summary>
        /// ClusterSeq
        /// </summary>
        string ClusterSeq { get; }

        /// <summary>
        /// IncludeScopes (默认true)
        /// </summary>
        bool IncludeScopes { get; }

        /// <summary>
        /// 邮件服务器
        /// </summary>
        string MailServer { get; }

        /// <summary>
        /// 发送邮件账号
        /// </summary>
        string FromMail { get; }

        /// <summary>
        /// 邮箱账号
        /// </summary>
        string MailAccount { get; }

        /// <summary>
        /// 邮箱密码
        /// </summary>
        string MailPassword { get; }

        /// <summary>
        /// 接收邮件账号列表
        /// </summary>
        string ToMails { get; }

        /// <summary>
        /// 邮件主题
        /// </summary>
        string SubjectName { get; }

        /// <summary>
        /// Levels
        /// </summary>
        List<LogLevel> Levels { get; }

        /// <summary>
        /// IsAsyn (默认 true)
        /// </summary>
        bool IsAsyn { get; }

        /// <summary>
        /// 最大排队长度 （默认 10240）
        /// </summary>
        int MaxQueuedLength { get; }

        /// <summary>
        /// 获得/设置 实例销毁时日志任务等待时间 默认为 2 秒
        /// </summary>
        TimeSpan TaskWaitTime { get; }

        /// <summary>
        /// ChangeToken
        /// </summary>
        IChangeToken ChangeToken { get; }

        /// <summary>
        /// TryGetSwitch
        /// </summary>
        /// <param name="name">name</param>
        /// <param name="level">level</param>
        /// <returns></returns>
        bool TryGetSwitch(string name, out LogLevel level);

        /// <summary>
        /// Reload
        /// </summary>
        /// <returns></returns>
        IEmailLoggerSettings Reload();
    }
}
